<h1 id="lscpu">lscpu</h1>
<p>显示有关CPU架构的信息</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>lscpu命令</strong> 是显示有关CPU架构的信息。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">lscpu [选项]</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash"> -a, --all               打印在线和离线CPU（默认为-e）
 -b, --online            仅打印在线CPU（-p的默认值）
 -c, --offline           打印离线CPU
 -e, --extended[=&lt;list&gt;] 打印出一个扩展的可读格式
 -p, --parse[=&lt;list&gt;]    打印出可解析的格式
 -s, --sysroot &lt;dir&gt;     将指定的目录用作系统根目录
 -x, --hex               打印十六进制掩码，而不是CPU列表

 -h, --help     显示此帮助并退出
 -V, --version  输出版本信息并退出</code></pre>
<h3 id="参数">参数</h3>
<div class="sourceCode" id="cb3"><pre><code class="language-bash"><a class="sourceLine" id="cb3-1" data-line-number="1">可用列：</a>
<a class="sourceLine" id="cb3-2" data-line-number="2">           <span class="ex">CPU</span>  逻辑CPU编号</a>
<a class="sourceLine" id="cb3-3" data-line-number="3">          <span class="ex">CORE</span>  逻辑核心号码</a>
<a class="sourceLine" id="cb3-4" data-line-number="4">        <span class="ex">SOCKET</span>  逻辑套接字号</a>
<a class="sourceLine" id="cb3-5" data-line-number="5">          <span class="ex">NODE</span>  逻辑NUMA节点号</a>
<a class="sourceLine" id="cb3-6" data-line-number="6">          <span class="ex">BOOK</span>  逻辑书号</a>
<a class="sourceLine" id="cb3-7" data-line-number="7">         <span class="ex">CACHE</span>  显示了如何在CPU之间共享高速缓存</a>
<a class="sourceLine" id="cb3-8" data-line-number="8">  <span class="ex">POLARIZATION</span>  虚拟硬件上的CPU调度模式</a>
<a class="sourceLine" id="cb3-9" data-line-number="9">       <span class="ex">ADDRESS</span>  CPU的物理地址</a>
<a class="sourceLine" id="cb3-10" data-line-number="10">    <span class="ex">CONFIGURED</span>  显示管理程序是否分配了CPU</a>
<a class="sourceLine" id="cb3-11" data-line-number="11">        <span class="ex">ONLINE</span>  显示Linux是否正在使用CPU</a></code></pre></div>
<h3 id="例子">例子</h3>
<div class="sourceCode" id="cb4"><pre><code class="language-bash"><a class="sourceLine" id="cb4-1" data-line-number="1">[<span class="ex">root@localhost</span> ~]# lscpu</a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="ex">Architecture</span>:          x86_64</a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="ex">CPU</span> op-mode(s)<span class="bu">:</span>        32-bit, 64-bit</a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="ex">Byte</span> Order:            Little Endian</a>
<a class="sourceLine" id="cb4-5" data-line-number="5"><span class="ex">CPU</span>(s)<span class="bu">:</span>                4</a>
<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="ex">On-line</span> CPU(s) <span class="ex">list</span>:   0-3</a>
<a class="sourceLine" id="cb4-7" data-line-number="7"><span class="ex">Thread</span>(s) <span class="ex">per</span> core:    1</a>
<a class="sourceLine" id="cb4-8" data-line-number="8"><span class="ex">Core</span>(s) <span class="ex">per</span> socket:    4</a>
<a class="sourceLine" id="cb4-9" data-line-number="9"><span class="ex">Socket</span>(s)<span class="bu">:</span>             1</a>
<a class="sourceLine" id="cb4-10" data-line-number="10"><span class="ex">NUMA</span> node(s)<span class="bu">:</span>          1</a>
<a class="sourceLine" id="cb4-11" data-line-number="11"><span class="ex">Vendor</span> ID:             GenuineIntel</a>
<a class="sourceLine" id="cb4-12" data-line-number="12"><span class="ex">CPU</span> family:            6</a>
<a class="sourceLine" id="cb4-13" data-line-number="13"><span class="ex">Model</span>:                 30</a>
<a class="sourceLine" id="cb4-14" data-line-number="14"><span class="ex">Model</span> name:            Intel(R) <span class="ex">Xeon</span>(R) <span class="ex">CPU</span>           X3430  @ 2.40GHz</a>
<a class="sourceLine" id="cb4-15" data-line-number="15"><span class="ex">Stepping</span>:              5</a>
<a class="sourceLine" id="cb4-16" data-line-number="16"><span class="ex">CPU</span> MHz:               2394.055</a>
<a class="sourceLine" id="cb4-17" data-line-number="17"><span class="ex">BogoMIPS</span>:              4788.11</a>
<a class="sourceLine" id="cb4-18" data-line-number="18"><span class="ex">Virtualization</span>:        VT-x</a>
<a class="sourceLine" id="cb4-19" data-line-number="19"><span class="ex">L1d</span> cache:             32K</a>
<a class="sourceLine" id="cb4-20" data-line-number="20"><span class="ex">L1i</span> cache:             32K</a>
<a class="sourceLine" id="cb4-21" data-line-number="21"><span class="ex">L2</span> cache:              256K</a>
<a class="sourceLine" id="cb4-22" data-line-number="22"><span class="ex">L3</span> cache:              8192K</a>
<a class="sourceLine" id="cb4-23" data-line-number="23"><span class="ex">NUMA</span> node0 CPU(s)<span class="bu">:</span>     0-3</a></code></pre></div>
<!-- Linux命令行搜索引擎：https://jaywcjlove.github.io/linux-command/ -->
